#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive

${HIVE_HOME} -S -e "
insert into edu_dwb.dwb_access_consul_detail
select
t1.id,
t1.create_date_time,
t1.session_id,
t1.sid,
cast(t1.create_time as string) as create_time,
t1.seo_source,
t1.seo_keywords,
t1.ip,
t1.area,
t1.country,
t1.province,
t1.city,
t1.origin_channel,
t1.`user`,
t1.manual_time,
t1.begin_time,
t1.end_time,
t1.last_customer_msg_time_stamp,
t1.last_agent_msg_time_stamp,
t1.reply_msg_count,
t1.msg_count,
t1.browser_name,
t1.os_info,
t2.from_url
from edu_dwd.ft_edu_dwd_web_chat_ems_2019_07 t1
left join edu_dwd.ft_edu_dwd_web_chat_text_ems_2019_07 t2
on t1.id=t2.id;
"